/**
 * 
 */
package com.blumov.fastbox.application.exceptions;

import java.io.IOException;

import com.blumov.fastbox.domain.enums.ErrorCode;
import com.blumov.fastbox.domain.enums.InformationCode;
import com.blumov.fastbox.domain.exceptions.BusinessException;
import com.blumov.fastbox.domain.exceptions.NonBusinessException;

/**
 * 
 *
 */
public class ThrowExceptionServiceImpl implements ThrowExceptionService {

	/*
	 * (non-Javadoc)
	 * 
	 * @seecom.epidataconsulting.vdh.networking.services.exceptions.ThrowExceptionService#
	 * throwsARuntimeException()
	 */
	public void throwsARuntimeException() {
		String message = "this exception is runtime!";
		throw new RuntimeException(message);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.epidataconsulting.vdh.networking.services.exceptions.ThrowExceptionService#throwsAnException
	 * ()
	 */
	public void throwsAnException() throws Exception {
		String message = "this exception is checked!";
		throw new Exception(message);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @seecom.epidataconsulting.vdh.networking.services.exceptions.ThrowExceptionService#
	 * throwsANonBusinessException()
	 */
	public void throwsANonBusinessException() {
		throw new NonBusinessException(ErrorCode.E0000);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @seecom.epidataconsulting.vdh.networking.services.exceptions.ThrowExceptionService#
	 * throwsABusinessException()
	 */
	public void throwsABusinessException() {
		throw new BusinessException(InformationCode.G0);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @seecom.epidataconsulting.vdh.networking.services.interceptor.ThrowExceptionService#
	 * throwsAnotherException()
	 */
	public void throwsAnotherException() throws Exception {
		String message = "this exception inherits from " + Exception.class.getSimpleName();
		throw new IOException(message);
	}

}
